package com.chukun.disruptor.higher.chain;

import com.lmax.disruptor.EventTranslator;

/**
 * disruptor发布对象
 */
public class TradeEventTranslator implements EventTranslator<Trade> {

    @Override
    public void translateTo(Trade trade, long l) {
          this.generatedTradeEvent(trade);
    }
    public void generatedTradeEvent(Trade trade){
        trade.setPrice(Math.random()*1000);
    }
}
